import 'package:flutter_model_package/TuitionOrder.dart';
import 'package:flutter_model_package/parse_base.dart';
import 'package:flutter_model_package/student.dart';
import 'package:parse_server_sdk/parse_server_sdk.dart';

class TuitionOrderItem extends MSParseBase {
  TuitionOrderItem() : super("TuitionOrderItem");

  TuitionOrderItem.cloe() : this();

  @override
  TuitionOrderItem clone(Map<String, dynamic> map) =>
      TuitionOrderItem.cloe()..fromJson(map);

  static forStudent(Student student, DateTime month) =>
      QueryBuilder(TuitionOrderItem())
        ..includeObject(['service.service'])
        ..whereMatchesQuery("order", TuitionOrder.forStudent(student, month));

   QueryBuilder<TuitionOrderItem> forStudentMeal(
      Student student, DateTime month) {
    return QueryBuilder(this)
      ..includeObject(['service', 'order'])
      ..whereMatchesQuery("order", TuitionOrder.forStudent(student, month))
      ..whereMatchesQuery("service", QueryBuilder(ParseObject("TuitionService"))
      ..whereContains("code", "TUIMEAL"));
  }
}
